package com.adnaan.backend.mapper;

import com.adnaan.backend.entity.UserLikes;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;

@Mapper
public interface UserLikesMapper {
    void deleteLike(Long userId, Long articleId);

    UserLikes selectByUserIdAndArticleId(Long userId, Long articleId);

    int insert(UserLikes userLikes);

    /**
     * 统计指定时间范围内每天的点赞数
     */
    List<Map<String, Object>> countGroupByDate(@Param("startTime") LocalDateTime startTime, @Param("endTime") LocalDateTime endTime);
}
